import Taro from '@tarojs/taro'
import { View, Text, Image } from "@tarojs/components";
import './index.scss';

class NewRecordItem extends Taro.Component {
    static defaultProps = {
        signRecord: {},
        toDetails: ()=>{}
    }
    constructor(props) {
        super(props);
        this.state = {}
    }
    componentWillMount() {
    }
    render() {
        let { signRecord, toDetails } = this.props;
        return (
            <View className='recordItem ov_h bdr_10 mb-2-5 p-2-5 pb-4-5 bg_fff' data={signRecord} onClick={(e) => { toDetails(e,signRecord) }}>
                <View className='flex flex-item-between flex-item-v-center'>
                    <View className='flex flex-r flex-item-v-center'>
                        <Text className='ft32'>{signRecord.ward}</Text>
                        <View className='tag fc_FFF ft24 ml-4'>{signRecord.department}</View>
                    </View>
                    <Image style={{ width: Taro.pxTransform(10), height: Taro.pxTransform(19) }} src={require('../../assets/imgs/sigin/icon_pressed.png')} />
                </View>
                <View className='mt-4-5 flex flex-item-between flex-item-v-center ft26'>
                    <Text className='fc_960'>巡检人：{signRecord.xm}</Text>
                    <Text className='fc_999'>巡检时间：{signRecord.months}{signRecord.time }</Text>
                </View>
            </View>
        );
    }
}

export default NewRecordItem;